<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="com.goodedeeds.webapp.controller.ResourcePageAction" %>
<%@ page import="com.goodedeeds.domain.IResourcePage" %>
<%@ page import="com.goodedeeds.domain.impl.db.ResourcePage" %>
<%--@elvariable id="actionBean" type="com.goodedeeds.webapp.controller.ResourcePageAction"--%>
<%@ include file="/WEB-INF/jsp/include/taglibs.jsp"%>
<div style="text-align: center; font-size: 1.5em;">List</div>

<div>
    <stripes:link href="<%=ResourcePageAction.URL%>" event="edit">
        <stripes:param name="pageResourceType" value="${actionBean.pageResourceType}"/>
        <stripes:param name="pageResourceId" value="${actionBean.pageResourceId}"/>
        Create Resource Page
    </stripes:link>
</div>

<c:if test="${!empty actionBean.resourcePages}">
    <table>
        <tr>
            <td>Page ID</td>
            <td>Page Resource Type</td>
            <td>Page Resource ID</td>
            <td>Page Type</td>
            <td>Page Name</td>
            <td>Actions</td>
        </tr>
        <c:forEach items="${actionBean.resourcePages}" var="vendor">
            <tr>
                <td>${vendor.pageId}</td>
                <td>${vendor.parentResourceType}</td>
                <td>${vendor.parentResourceId}</td>
                <td>${vendor.pageType}</td>
                <td>${vendor.pageName}</td>
                <td>
                    <stripes:link href="<%=ResourcePageAction.URL%>" event="edit">
                        <stripes:param name="pageId" value="${vendor.pageId}"/>
                        Edit
                    </stripes:link> |
                    <stripes:link href="<%=ResourcePageAction.URL%>" event="view">
                        <stripes:param name="pageId" value="${vendor.pageId}"/>
                        View
                    </stripes:link>
                </td>
            </tr>
        </c:forEach>
    </table>
</c:if>